#!/usr/bin/env bash

cd $(dirname $0)

JSON_FORMAT=$(cat <<EOF

import sys
import json
str=""
for line in sys.stdin:
    str+=line
print(json.dumps(json.loads(str), ensure_ascii=False, indent=4, sort_keys=True))
EOF
)

paras=$(cat <<'EOF'
{
}
EOF
）

cmd="curl -X POST -d '$paras' localhost:8888/hello/test"
echo $cmd
eval $cmd | python3 -c "$JSON_FORMAT"
#curl -X POST -d "{}" localhost:8888/hello/test | python3 -c "$JSON_FORMAT"
